{% extends "base.html" %}
{% block heads %}{% if can_edit %}
  <link rel="alternate" type="application/x-wiki" href="/w/edit?page={{ page.title|uurlencode }}"/>
{% endif %}{% endblock %}
{% block title %}{{ page.get_display_title|escape }}{% if settings.wiki_title %} — {{ settings.wiki_title|escape }}{% endif %}{% endblock %}
{% block content %}

{% if can_edit %}
      <a class="view" href="{{ page.title|pageurl }}">View</a>
      <a href="/w/edit?page={{ page.title|uurlencode }}{% if page.revision %}&amp;r={{ page.revision }}{% endif %}">Edit</a>
      {% if map_url %}
        <a href="{{ map_url }}">Map</a>
      {% endif %}
      <a href="/w/history?page={{ page.title|uurlencode }}">History</a>      
{% endif %}  

<div class="wtabs extl" id="pb">
  {% if page.body %}
    {% if is_plain %}
      <pre>{{ page|wikify_page }}</pre>
    {% else %}
      {{ page|wikify_page }}
      {% if page_labels %}
        <p class="categories">{% if settings.labels_text %}{{ settings.labels_text }}{% else %}Labels{% endif %}: {% for label in page_labels %}{% if forloop.first %}{% else %}, {% endif %}<a class="int" href="{{ label|labelurl }}">{{ label|escape }}</a>{% endfor %}.</p>
      {% endif %}
      {% if page.comments_enabled %}
        {{ settings.comments_code }}
      {% endif %}
    {% endif %}
  {% else %}
    <h1>{{ page.title }}</h1>
    <p>This page does not exist.</p>
    <form method="get" action="/w/edit">
      <input type="hidden" name="page" value="{{ page.title|escape }}"/>
      <input type="submit" value="Create it"/>
    </form>
  {% endif %}
</div>
{% endblock %}
